package main.strategy;

import configuration.RobConfiguration;
import mysql.MysqlUtil;
import user.IUser;

import static http.util.PrintUtil.printTitle;
import static timer.saveCoursesManager.getGlobalIdAndCourseNameCache;


public class backupCourseListStrategy implements RobStrategy {
    @Override
    public void execute(IUser user) {
        try{
            MysqlUtil.updateCourseTables(RobConfiguration.ROB_CHANNEL.name() + "_" + RobConfiguration.ROB_COURSE_TYPE.name(), getGlobalIdAndCourseNameCache());
            printTitle("手动备份课表完毕");
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
